#!/bin/sh
workdir=$(cd $(dirname $0); pwd)

mkdir -p models/res50/coco
cd models/res50/coco
if [ ! -f "faster_rcnn_1_10_1663.pth" ]; then
  echo "download faster_rcnn_1_10_1663.pth ..."
else
  rm faster_rcnn_1_10_1663.pth
  echo "delete faster_rcnn_1_10_1663.pth ..."
fi

wget http://jario.ren/models/OSOD/faster_rcnn_1_10_1663.pth

cd $workdir
cd ..
mkdir -p data/coco/annotations
cd data/coco/annotations
if [ ! -f "instances_val2017.json" ]; then
  echo "download instances_val2017.json ..."
else
  rm instances_val2017.json
  echo "delete instances_val2017.json ..."
fi
wget http://jario.ren/models/OSOD/instances_val2017.json

cd $workdir
cd ..
mkdir -p data/coco_reference_image
cd data/coco_reference_image
if [ ! -f "coco_val2017_e2e_mask_rcnn_R_101_FPN_1x_caffe2.pkl" ]; then
  echo "download coco_val2017_e2e_mask_rcnn_R_101_FPN_1x_caffe2.pkl ..."
else
  rm coco_val2017_e2e_mask_rcnn_R_101_FPN_1x_caffe2.pkl
  echo "delete coco_val2017_e2e_mask_rcnn_R_101_FPN_1x_caffe2.pkl ..."
fi
wget http://jario.ren/models/OSOD/coco_val2017_e2e_mask_rcnn_R_101_FPN_1x_caffe2.pkl

cd $workdir
cd ..
mkdir -p data/coco/images
cd data/coco/images
if [ ! -f "val2017.zip" ]; then
  echo "download val2017.zip ..."
else
  rm val2017.zip
  echo "delete val2017.zip ..."
fi
wget http://jario.ren/models/OSOD/val2017.zip
unzip val2017.zip

cd $workdir
